public class Solution55 {
    public boolean canJump(int[] nums) {
        int end = 0, cur = 0;
        while (cur <= end) {
            end = Math.max(end, cur + nums[cur]);
            cur++;
            if (cur == nums.length) {
                return true;
            }
        }
        return false;
    }
}
